package com.zhihu_lvliangi_android.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.http.client.entity.UrlEncodedFormEntity;

import android.R.color;

/**
 * 网络接口
 *
 * @author 徐宇健
 *
 */
public class RequestURL {
	private static String httpHost  = "http://59.48.248.2:7021/" ;
	public static void setHttpHost(String ip,String port){
		httpHost = "http://"+ip+":"+port+"/";
	}

	private static String logUrl="";
	//=================================webview接口=========================================
	/***
	 * 天气接口
	 * @param city
	 * @return
	 */
	public static String getWeatherUrl(String city){
		try {
			return "http://api.map.baidu.com/telematics/v3/weather?location="
					+ URLEncoder.encode(city, "UTF-8") + "&output=json&ak="
					+ Constant.KEY_BAIDU_AK;
		} catch (UnsupportedEncodingException e) {
			return "";
		}
	}
	/**
	 * 违章查询
	 * @param city
	 * @return
	 */
	public static String getVehicleRecordUrl(){
		return "http://183.203.18.32:8080/driver/pages/carbible_wap/illegal/illegal_index.jsp#";
	}
	/**
	 * 办事指南
	 * @param city
	 * @return
	 */
	public static String getAffairGuideUrl(){
		return "http://183.203.18.32:8080/driver/guideWeb/project!sylist.action?areacode=140100";
	}
	/**
	 * 违章缴费
	 * @param city
	 * @return
	 */
	public static String getPayCostUrl(){
		return "http://211.142.5.188:8069/wxsx_zy/fine/index.jsp?sticket=&userid=&areacode=140100&portaltype=2&pt=2&ua=720_1280";
	}
	/**
	 * 便民路况
	 * @param city
	 * @return
	 */
	public static String getRoadInfoUrl(){
		return "http://183.203.18.32:8080/driver/road/roadCon!roadIndex.action?city=141100";
	}
	/**
	 * 预约代驾
	 * @param city
	 * @return
	 */
	public static String getYuYueDaiJiaUrl(){
		return "http://211.142.5.188:8069/wxsx_zy/driving_agent/index.jsp?portaltype=2&version=3&areacode=140100&portaltype=2&resourceid=null";
	}
	/**
	 * 公交查询
	 * @param city
	 * @return
	 */
	public static String getBusRideUrl(){
		return "http://221.180.20.236/app/jumpindex.action?symbol=gjccx&sticket=&userid=&areacode=141100&portaltype=2&pt=2&ua=720_1280";
	}
	/**
	 * 人人当交警
	 * @param city
	 * @return
	 */
	/*public static String getTrafficUrl(){
		return "http://www.sxgajj.gov.cn/web/index.php/Traffic";
	}*/
	/**
	 * 停车无忧
	 * @param city
	 * @return
	 */
	public static String getCarPartUrl(){
		return "http://183.203.18.32:8080/driver/pages/guideWeb/carpark!toCarMap.action?entity.areacode=140100";
	}
	/**
	 * 茶周边
	 * @param city
	 * @return
	 */
	public static String getMyRimUrl(){
		return "http://211.142.5.188:8069/wxsx_zy/poi/lcwapslisseat.action?StatusCode=606&SessionId=&Result=";
	}


	/**
	 * 智慧旅游
	 * @param city
	 * @return
	 */
	public static String getTourUrl(){
		return "http://183.203.16.214/index.action?headerNoShow=1";
	}

	/**
	 * 药店查询
	 * @param city
	 * @return
	 */
	public static String getDrugStoreSearchUrl(){
		return "http://map.baidu.com/mobile/webapp/search/search/qt=s&wd=%E5%90%95%E6%A2%81%E8%8D%AF%E5%BA%97&c=176&searchFlag=bigBox&version=5&exptype=dep&nb_x=12531777&nb_y=4525214&center_rank=1/vt=?qq-pf-to=pcqq.c2c";
	}
	/**
	 * 药品查询
	 * @param city
	 * @return
	 */
	public static String getDrugSearchUrl(){
		return "http://wapypk.39.net/";
	}

	/**
	 * 预约挂号
	 * @param city
	 * @return
	 */
	public static String getPreAppointUrl(){
		return "http://wy.guahao.com/";
	}
	/**
	 *儿童智能手表下载路径
	 * @param city
	 * @return
	 */
	public static String getzhihui_jiaoyu_download_Url(){
		return "http://183.203.36.9/sxm-crm-esop-pro/api/project/common/download.json?flag=19_r";
	}


	/**
	 * 智慧社区-智慧金融
	 * @return
	 */
	public static String getzhihui_shequ_financial(){
		return "http://114.215.194.59:8082/cloud/pages/html5/financialService/index.html";
	}

	/**
	 * 智慧社区-社区缴费
	 * @return
	 */
	public static String getzhihui_shequ_paycost(){
		return "http://114.215.194.59:8082/cloud/pages/html5/communityPayCost/index.html";
	}
	/**
	 * 智慧社区-二手车
	 * @return
	 */
	public static String getzhihui_shequ_usedcar(){
		return "http://114.215.194.59/weixin/wap.php?group";
	}
	/**
	 * 智慧社区-居委会
	 * @return
	 */
	public static String getzhihui_shequ_juweihui(){
		return "http://114.215.194.59:8082/cloud/pages/html5/committee/xcxx.html";
	}
	


	/**
	 * 首页-电费查缴
	 * @return
	 */
	public static String home_pay_electricity(){
		return "http://211.137.180.20:28010/wxcs/app?resourceid=SV370000000114&usessionid=&sticket=&portaltype=1&areacode=370100&version=3&by=relative&uc_param_str=dnntnwvepffrgibijbprsv&dn=15935952473-c65fc445&nt=2&nw=WIFI&ve=10.0.0.488&pf=145&fr=android&pr=UCMobile&sv=ucpatch2&from=ucframe";
	}
	/**
	 * 首页-车主宝典
	 * @return
	 */
	public static String home_car_suggesstion(){
		return "http://183.203.18.32:8080/driver/page/main.jsp?portaltype=2&sticket=&userid=&areacode=141100&portaltype=2&pt=2&ua=720_1280";
	}
	/**
	 * 就业保障-就业指南
	 * @return
	 */
	public static String employment_zhinan(){
		return "http://zm8.sm.cn/?src=http%3A%2F%2Fwww.eol.cn%2Fjiuye_zhn_4342%2F&uid=010cb0b907f45c5004fa290e4cb6b479&hid=99659d74d0cc83e27d5797be6b19554d&pos=4&cid=9&time=1421203782905&from=click&restype=1&pagetype=0000000000000804&uc_param_str=pidi";
	}

	/**
	 * 就业保障-招聘信息
	 * @return
	 */
	public static String employment_msg(){
		return "http://m.51job.com/?partner=sem_shenma_5";
	}
	/**
	 * 就业保障-岗位查询
	 * @return
	 */
	public static String employment_query(){
		return "http://m.51job.com/search/jobsearch.php";
	}
	/**
	 * 就业保障-培训机构
	 * @return
	 */
	public static String employment_training(){
		return "http://zm8.sm.cn/?src=http%3A%2F%2Fwww.szpxe.com%2Franking%2F&uid=010cb0b907f45c5004fa290e4cb6b479&hid=43ba037fa720dfc71be8bfa18f62f6a8&pos=1&cid=9&time=1421204797273&from=click&restype=1&pagetype=0000000000000804&uc_param_str=pidi";
	}

	/**
	 * 就业保障-人才市场招聘会
	 * @return
	 */
	public static String employment_people(){
		return "http://www.58.com/zhaopinhui/ ";

	}






	//=================================webview接口=========================================
	
	//=================================服务接口=========================================

	/**
	 * 查询面向企业的办事指南类型
	 * @return
	 */
	public static String getGuideTypesForTheme(){
		return httpHost+"llwx/service/guide.do?method=guideTypes&tobj=1";
	}
	
	/**
	 * 查询面向企业的办事指南类型
	 * @return
	 */
	public static String getGuideTypesForEnterprise(){
		return httpHost+"llwx/service/guide.do?method=guideTypes&tobj=2";
	}
	/**
	 * 查询部门
	 * @return
	 */
	public static String getGuideTypesForDepartment(){
		return httpHost+"llwx/service/guide.do?method=guideDepts";
	}
	
	/**
	 * 根据部门id 查询指南
	 * @return
	 */
	public static String getGuideByDepartmentID(String id){
		System.out.println("getGuideByDepartmentID ="+httpHost+"llwx/service/guide.do?method=guideItems&did="+id);
		return httpHost+"llwx/service/guide.do?method=guideItems&did="+id;
	}
	
	/**
	 * 查询办事指南BytId
	 * @return
	 */
	public static String getGuideItemByTypeID(String id){
		logUrl= httpHost+"llwx/service/guide.do?method=guideItems&tId="+id;
		System.out.println(logUrl);
		return logUrl;
	}
	/**
	 * 查询办事指南BydId
	 * @return
	 */
	public static String getGuideItemByDepartmentID(String id){
		logUrl =httpHost+"llwx/service/guide.do?method=guideItems&dId="+id;
		System.out.println(logUrl);
		return logUrl;
	}
	/**
	 * 查询新闻
	 * @return
	 */
	public static String getNewsList(){
		return httpHost+"/llwx/service/news.do?method=newsList";
	}
	/**
	 * 查询新闻详情页面
	 * @return
	 */
	public static String getNewsHtml(String id){
		return httpHost+"/llwx/service/news/"+id+".html";
	}














}
